package com.tjsinfo.tjsoa.workReport.action;



import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;


import com.tjsinfo.tjsoa.common.PaginationSupport;
import com.tjsinfo.tjsoa.common.SessionUser;
import com.tjsinfo.tjsoa.system.vo.User;
import com.tjsinfo.tjsoa.workReport.bo.TResourceWorkReportManage;

public class WorkReportMeListAction extends Action {
	private TResourceWorkReportManage resourceWorkReportManage;
	
	

	public TResourceWorkReportManage getResourceWorkReportManage() {
		return resourceWorkReportManage;
	}



	public void setResourceWorkReportManage(
			TResourceWorkReportManage resourceWorkReportManage) {
		this.resourceWorkReportManage = resourceWorkReportManage;
	}
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		try {
			User user = SessionUser.getUser(request);
			Integer pageSize=12;
			String pageStr=request.getParameter("pageNo");
			if(pageStr==null)pageStr="0";
			int page=Integer.valueOf(pageStr).intValue();
			PaginationSupport paginationSupport=resourceWorkReportManage.findOrderList(user.getUser_id(),page,pageSize);
			request.setAttribute("paginationSupport", paginationSupport);
			return mapping.findForward("success");
		} catch (Exception e) {
			e.printStackTrace();
			return mapping.findForward("failed");
		}
	}
}
